package com.lhn.service.impl;

import com.lhn.dao.AccountDao;
import com.lhn.domain.Account;
import com.lhn.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author lhn
 * @date 2024-08-19 20:08
 */
@Service
public class AccountServiceImpl implements AccountService {
    @Autowired
    AccountDao accountDao;
    @Override
    public void save(Account account) {
        System.out.println("account service save ..." + account);
        accountDao.save(account);
    }

    @Override
    public void delete(Integer id) {
        System.out.println("account service delete ..." + id);
        accountDao.delete(id);
    }

    @Override
    public void update(Account account) {
        System.out.println("account service update ..." + account);
        accountDao.update(account);
    }

    @Override
    public List<Account> findAll() {
        System.out.println("account service findAll ...");
        List<Account> accounts = accountDao.findAll();
        return accounts;
    }

    @Override
    public Account findById(Integer id) {
        System.out.println("account service findById ..." + id);
        return accountDao.findById(id);
    }
}
